import React from 'react';
import PropTypes from 'prop-types';
import turboIcon from './icon--turbo.svg';
import styles from './turbo-mode.css';

const TurboMode = function (props) {
    const {
        turbo,
        onClick,
        ...componentProps
    } = props;

    return (        
        <div 
            className={styles.turboContainer}
            onClick={onClick}
        >
        {turbo ? (<>
            <img className={styles.turboIcon} src={turboIcon}/>
            <div className={styles.turboLabel}>关闭加速模式</div>
        </>) : (
            <div className={styles.turboLabel}>打开加速模式</div>
        )}
        </div>
    );
};

TurboMode.propTypes = {
    onClick: PropTypes.func.isRequired,
    turbo: PropTypes.bool
};
export default TurboMode;
